import req from '@/utils/request'
import Qs from 'qs'
import { JIEMA } from '@/utils/local'
// const baseURL = process.env.VUE_APP_JIEMA_URL
const baseURL = JIEMA
const baseURL_APPCENTER = process.env.VUE_APP_IOTBACK_URL
export function jiemaQueryProjects(params) {
    return req({
        method: 'get',
        url: baseURL_APPCENTER + "/appCenter/list",
        params
    })
}
export function jiemaByTemplate(params) {
    return req({
        method: 'get',
        url: baseURL_APPCENTER + "/appCenter/add/byTemplate",
        params
    })
}
export function jiemaCollectionProject(data) {
    return req({
        method: 'post',
        url: baseURL + "/project/collectionProject",
        data
    })
}
export function tesQueryProjects(data) {
    return req({
        method: 'post',
        url: baseURL + "/project/queryProjects",
        data
    })
}
export function jiemaQueryRelease(data) {
    return req({
        method: 'post',
        url: baseURL + "/project/queryRelease",
        data
    })
}
export function jiemaGetPageList(data) {
    return req({
        method: 'post',
        url: baseURL + "/page/getPageList",
        data
    })
}
export function jiemaGetPageInfoList(data) {
    return req({
        method: 'post',
        url: baseURL + "/page/getPageInfoList",
        data
    })
}
export function jiemaCopyProject(data) {
    return req({
        method: 'post',
        url: baseURL + "/project/copyProject",
        data
    })
}
export function jiemaDownloadReleaseProjectV2Async(data) {
    return req({
        method: 'post',
        url: baseURL + "/project/downloadReleaseProjectV2Async",
        data
    })
}
export function jiemaDownloadProjectV2Async(data) {
    return req({
        method: 'post',
        url: baseURL + "/project/downloadProjectV2Async",
        data
    })
}
export function jiemaQueryDownloadProjectV2Async(data) {
    return req({
        method: 'post',
        url: baseURL + "/project/queryDownloadProjectV2Async",
        data
    })
}
export function jiemaMobilePackTask(data) {
    return req({
        method: 'post',
        url: baseURL + "/package/mobilePackTask",
        data
    })
}

export function jiemaPreview(data) {
    return req({
        method: 'post',
        url: baseURL + "/project/preview",
        data
    })
}

export function jiemaLogin(data) {
    return req({
        method: 'get',
        url: baseURL_APPCENTER + "/appCenter/token",
    })
}

export function jiemaGetOwnTheme(data) {
    return req({
        method: 'get',
        url: baseURL + "/rbTheme/getOwnTheme",

    })
}

export function jiemaAddProjectV2(data) {
    return req({
        method: 'post',
        url: baseURL + "/project/addProjectV2",
        data: Qs.stringify(data),
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
    })
}
export function jiemaAddProjectV2Add(params) {
    return req({
        method: 'get',
        url: baseURL_APPCENTER + "/appCenter/add",
        params,
    })
}


export function jiemaDelete(params) {
    return req({
        method: 'get',
        url: baseURL_APPCENTER + "/appCenter/delete",
        params
    })
}
export function jiemaDeleteProjects(data) {
    return req({
        method: 'post',
        url: baseURL + "/project/deleteProject",
        data
    })
}

export function jiemaGetProductionList(data) {
    return req({
        method: 'post',
        url: baseURL + "/production/getProductionList",
        data
    })
}
// export function jiemaGetDicProviderInfo(data) {
//     return req({
//         method: 'get',
//         url: baseURL + "/user/getDicProviderInfo",

//     })
// }
export function jiemaCreateProductionProject(data) {
    return req({
        method: 'post',
        url: baseURL + "/production/createProductionProject",
        data
    })
}
// export function platlogin(data) {
//     return req({
//         method: 'post',
//         url: baseURL + "/platlogin",
//         data
//     })
// }


